<template>
  <div class="con-top">
    <el-table :data="list" style="width: 100%;">
      <el-table-column prop="name" label="产品名称" />
      <el-table-column prop="description" label="产品介绍" />
    </el-table>
    <ElConfigProvider :locale="zhCn">
      <el-pagination
        v-model:current-page="pageNum"
        v-model:page-size="pageSize"
        :page-sizes="[10, 20, 50, 100]"
        background
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
        @size-change="sizeChangeFn"
        @current-change="currentChangeFn"
      />
    </ElConfigProvider>
  </div>
</template>
<script setup lang="ts">
import userTable from '@/hooks/userTable'
import { productList } from './api'
import { ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
const {
  list,
  pageNum,
  pageSize,
  total,
  sizeChangeFn,
  currentChangeFn,
} = userTable(productList)
</script>
<style lang="less" scoped></style>
